package com.csx.micrometer.demo.consumer.util;

import java.util.Random;

/**
 * @author cuisongxu
 * @date 2022/11/15 14:58
 */
public class RandomUtil {

    public static int nextInt(int start, int end) {
        if(end - start < 0) {
            throw new RuntimeException("end less than start");
        }
        Random random = new Random();
        return start + random.nextInt(end - start);
    }
}
